<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script src="js/axios.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/vue.js" type="text/javascript" charset="utf-8"></script>
		<style type="text/css">
			
			.box{
				display: block;
				width: 200px;
				height: 300px;
				background-color: #6495ED;
				padding: 20px;
			}
		</style>
	</head>
	<body>
		
		<div id="app">
			<input type="button" name="" id="" value="获取笑话" @click="getJoke" />
			<div class="box">{{joke}}</div>
		</div>
		
	</body>
	<script type="text/javascript">
		
		var app = new Vue({
			el:"#app",
			data:{
				joke:"很好笑的笑话"
			},
			methods:{
				getJoke:function(){
					var that = this;
					axios.get("https://autumnfish.cn/api/joke").then
					(function(response){
						console.log(response.data);
						that.joke = response.data;
					},function(err){
						
					})
				}
			}
			
			
		})
		
	</script>
</html>
